<?php
$page_title="Manage Web Commitments ";
include("includes/header.php");

$commit_id=$_GET["commit_id"];
$query = "SELECT * FROM bkitc_member_commitment where rec_status=1 and commit_id=".$commit_id;
$mode=$_GET["mode"];


if($mode=="edit") 	$commitment_info=@array_pop(qry_data("select * from bkitc_member_commitment where commit_id=".$commit_id));
if($mode=="del"){
	exec_qry("update bkitc_member_commitment set rec_status=0 where commit_id=".$commit_id);//Soft Delete
	header("location:commitment_list.php");
}
?>				
<div class="fleft">
<ul class="subMenu">
<li><a href="commitment_list.php?mode=result">Back to  List </a></li>
</ul>
</div>
<div class="cleardiv"></div>
	<div style="width:100%" class="content_bg">
	<form method="post" action="edit_commitment_pro.php?commit_id=<?=$_GET["commit_id"]?>" > 
		<table class="edit_commitment_pro.php" width="600"  cellpadding="8" border="0" cellspacing="3"> 
			<tr>
				<td  height="10" style="padding:2px;margin:2px" colspan="2" align="right"><small style="font-size:11px"> <i><?=ast()?>  Required fields.</i></small></td>
			</tr>
			<tr>
				<td class="frmLabel1" valign="top" colspan="2"> <b>Member Info</b>
				<? $memInfo=getMemberInfo($commitment_info["member_id"]); ?>
				<div>Name : <?=$memInfo["full_name"]?> </div>			
				<div>Email : <?=$memInfo["email_id"]?> </div>			
				<div>Member Code : <a href="edit_member.php?mode=edit&mid=<?=$memInfo["registrant_id"]?>"><?=formatMemberCode($memInfo["registrant_id"])?></a> </div>			
				<br/>
				<div><b>Committed Date</b> :<?=$commitment_info["created_date"]?></div>
				
				
				
				</td>
				
			</tr>
				
			<tr>
				<td class="frmLabel" valign="top" colspan="2"> Commitment Text <?=ast()?><br/><br/>
				 <textarea class="txtarea"  id="message" rows="5" cols="90" name="message" style="width:800px;height:100px;"><?=$commitment_info["message"]?></textarea> </td>
			</tr>
			
			<tr>
			
			<td class="frmLabel" valign="top" colspan="2"> Display in Front : 
			<input type="radio" name="display_front" value="0"  <?=$commitment_info["display_front"]==0?"checked":""?>/>No
			<input type="radio" name="display_front" value="1" <?=$commitment_info["display_front"]==1?"checked":""?>/>Yes
			
			</tr>
			<tr>
			
			<td>
			<b>Action Plans :</b><br/>
			<?
			
			$planinfo=qry_data("select * from bkitc_member_actionplan where commit_id=".$commitment_info["commit_id"]);
			
			?>
			<div id="plans_<?=$commitment_info["commit_id"]?>">
			<? foreach($planinfo as $m=>$info1){ ?>
			<p><b>Action : <?=$m+1?></b></p>
			<p><?=$info1["actionplan"]?></p>
			<? } ?>
			</div>

			</td>
			
			</tr>
			<tr bgcolor="#fff" style="height:50px;margin:0px;padding:0px;">
				
				<td  style="margin:0px;padding:2px;" align="right" colspan="2">
				<input type="submit" class="button"  value="Save Info">&nbsp;
				<input class="button" type="reset">
				<input onclick="location.href='commitment_list.php'"  type="button" class="button" value=" Back to Commitment List">
				</td>
			</tr>
			
		</table>
	</form>
</div>

<div style="margin-bottom:40px">

</div>


<? include("includes/footer.php");?>
